#!/usr/bin/env python
# vi: et sw=2
#
# Gnome PulseAudio applet - Dock
# Copyright (C) 2009  Harry Karvonen
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
#
# Author: Harry Karvonen <harry.karvonen@gmail.com>
#         Aki Rautio <aki.rautio@gmail.com>
#

import pygtk
pygtk.require('2.0')

import gtk , gobject


################################################################################
#
# PulseAppletDock

class PulseAppletDock:
  def __init__(self):
    
    # Variables
    self.window   = gtk.Window(gtk.WINDOW_POPUP)
    self.itemSet  = None
    

    self.create_layout()
    self.update_streams(streams)    
    self.show()
    return

  ################
  ### Methods
  ###
  
  # Create

  def create_layout(self):
    
    self.itemSet = gtk.HBox(False,5)
    dockAlignment = gtk.Alignment(0.5, 0.5, 0, 0)
    dockAlignment.set_padding(2, 2, 2, 2) 
    dockAlignment.add(self.itemSet)

    dockFrame = gtk.Frame()
    dockFrame.set_shadow_type(gtk.SHADOW_OUT)    
    dockFrame.add(dockAlignment)
    

    self.window.add(dockFrame)
    return  
  
  ###

  def update_streams(self,streams):
    n = 0    
    while n < 5:
      item = PulseAppletDockItem()
      items.pack_start(item.return_item, False, False, 2)
      n = n +1
    self.itemSet.add(items)
    return 
  

  ## Show and Hide

  def show(self):
    self.window.show_all()
    return

  def hide(self):
    self.window.hide()    
    return


################################################################################
#
# PulseAppletDock

class PulseAppletDockItem:

  def __init__(self):
    
    # Variables
    self.volume = 0
   
    return

  ################
  ### Methods
  ###

  def create_layout(self):
    item = gtk.VBox()
      
    muteButton = gtk.Button("MUTE")
    item.pack_start(muteButton, False, False, 2)
    

    return

  ###


# If the program is run directly or passed as an argument to the python
# interpreter then create a HelloWorld instance and show it
if __name__ == "__main__":
    hello = PulseAppletDock()
    gtk.main()

